#include "BinaryTree.h"  
#include <iostream>  
using namespace std;



int main() {  
    // 创建一个 BinarySearchTree 对象并测试  
    BinarySearchTree<int> bst ;
    bst.insert(5);  
    bst.insert(3);  
    bst.insert(7);  
    std::cout << "Min: " << bst.findMin() << std::endl;  
    std::cout << "Max: " << bst.findMax() << std::endl;  
    std::cout << "Contains 3: " << bst.contains(3) << std::endl;  
    std::cout << "Contains 8: " << bst.contains(8) << std::endl;  

    bst.printTree();  

    // 创建一个 AvlTree 对象并测试  

    AvlTree<int> avl;
    avl.insert(5);  
    avl.insert(3);  
    avl.insert(7);  

    std::cout << "Min: " << avl.findMin() << std::endl;  
    std::cout << "Max: " << avl.findMax() << std::endl;  
    std::cout << "Contains 3: " << avl.contains(3) << std::endl;  
    std::cout << "Contains 8: " << avl.contains(8) << std::endl;  

    avl.printTree();  

    // 创建一个 RedBlackTree 对象并测试  
    const int NEG_INF = -9999;
    RedBlackTree<int>rb{ NEG_INF };  

    rb.insert(5);  
    rb.insert(3);  
    rb.insert(7);  

    std::cout << "Min: " << rb.findMin() << std::endl;  
    std::cout << "Max: " << rb.findMax() << std::endl;  
    std::cout << "Contains 3: " << rb.contains(3) << std::endl;  
    std::cout << "Contains 8: " << rb.contains(8) << std::endl;  
    rb.printTree();   

    // 创建一个 SplayTree 对象并测试  

    SplayTree<int>splay;  

    splay.insert(5);  
    splay.insert(3);  
    splay.insert(7);  

    std::cout << "Min: " << splay.findMin() << std::endl;  
    std::cout << "Max: " << splay.findMax() << std::endl;  
    std::cout << "Contains 3: " << splay.contains(3) << std::endl;  
    std::cout << "Contains 8: " << splay.contains(8) << std::endl;  

    splay.printTree();   


    
    return 0; 
}  